<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Inc_Home_Made_module extends CI_Module {
	private $_data;

	/**
	 * 构造函数
	 *
	 * @return void
	 * @author
	 **/
	function __construct()
	{
		parent::__construct();
		$this->_data = array();

		$this->load->model('Main_data_model');
	}


	/*function index()
	{
		// 这是装载本模块的模型，如果在本模块下找不到，则自动装载全局模型
		$this->load->model('Main_data_model');
		$this->Main_data_model->start();

		$this->load->view('view_test');
	}
	
	function marquee(){
		$this->load->view('view_marquee');
	}
	function protype_tree(){
		$this->load->model('Main_data_model');
		$inc_producttype=$this->Main_data_model->get_producttype();
		$this->_data['inc_producttype'] = $inc_producttype;
		$this->load->view('view_protypetree', $this->_data);
	}
	function contact_box(){
		$this->load->view('view_contact_box');
	}
	function footer(){
		$this->load->view('view_footer');
	}
	
	function header(){
		$navs = $this->db->get('about', 3);
		
		$data['index_nav'] = $navs->result();
		$this->load->view('header_menu', $data);
	}*/
	/**
	* 吉溶头部
	*/
	function jrheader($type=1){
		//新闻动态 
		// $a = $this->db->select('title')->from('article')->where('typeid',6)->limit(5);
		$this->db->select('title,id,createtime');
		$this->db->order_by('id', 'desc');
		$this->db->limit(5);
		$q = $this->db->get('article');
		$headerartlist = array();
		if($q){
			foreach ($q->result() as $row) {
				array_push($headerartlist, $row);
			}
		}
		$this->_data['headerartlist'] = $headerartlist;
		if($type == 2){
			$this->load->view('jrheadercommon', $this->_data);
		}else{
			$this->load->view('jrheader', $this->_data);
		}

		
	}function jrheadercommon(){
		//新闻动态 
		// $a = $this->db->select('title')->from('article')->where('typeid',6)->limit(5);
		$this->db->select('title,id,createtime');
		$this->db->order_by('id', 'desc');
		$this->db->limit(5);
		$q = $this->db->get('article');
		$headerartlist = array();
		if($q){
			foreach ($q->result() as $row) {
				array_push($headerartlist, $row);
			}
		}
		$this->_data['headerartlist'] = $headerartlist;
		
		$this->load->view('jrheadercommon', $this->_data);
		
	}


	/**
	* 吉溶尾部
	*/
	function jrfooter(){
		$this->load->model('product_model');
		$d = $this->product_model->get_ptype();
		$this->_data['ptypes'] = $d;
		$this->load->view('jrfooter', $this->_data);
	}
	/**
	* 图片联系模块
	*/
	function salemod(){
		$this->load->view('salemod', $this->_data);
	}
	/**
	* 公告模块
	*/
	function broadcastmod(){
		$this->_data['broadcasts'] = $this->Main_data_model->get_broadcast();
		$this->load->view('broadcastmod', $this->_data);
	}

	function producttypemod(){
		
		$this->_data['types'] = $this->Main_data_model->get_producttype();
		$this->load->view('producttypemod', $this->_data);
	}
}